set(libpresto_src
    amoeba.c
    apprgrdn.c
    atwood.c
    backend_common.c
    barycenter.c
    birdzap.c
    bpp.c
    cand_output.c
    characteristics.c
    chkio.c
    cldj.c
    clipping.c
    com.c
    corr_prep.c
    corr_routines.c
    correlations.c
    database.c
    dcdflib.c
    dispersion.c
    djcl.c
    fastffts.c
    fftcalls.c
    fitsfile.c
    fminbr.c
    fold.c
    fresnl.c
    get_candidates.c
    hget.c
    hput.c
    imio.c
    ioinf.c
    iomak.c
    ipmpar.c
    least_squares.f
    mask.c
    maximize_r.c
    maximize_rz.c
    median.c
    minifft.c
    misc_utils.c
    multi_prof_plot.c
    multibeam.c
    orbint.c
    output.c
    polycos.c
    powerplot.c
    psrfits.c
    randlib.c
    rdascat.f
    responses.c
    rfi_utils.c
    rfifind_plot.c
    rzinterp.c
    rzwinterp.c
    range_parse.c
    readpar.c
    read_fft.c
    select.c
    sigproc_fb.c
    solvopt.c
    sorter.c
    spigot.c
    swapendian.c
    transpose.c
    twopass_real_fwd.c
    twopass_real_inv.c
    twopass.c
    vectors.c
    xyline.c
    zapping.c
    zerodm.c
)

add_library(presto SHARED ${libpresto_src})

target_link_libraries(presto PUBLIC cpgplot fftw3 fftw3f cfitsio m)

install(TARGETS presto LIBRARY DESTINATION lib)